package result;

import java.io.Serializable;
import java.util.LinkedList;
import java.util.Observable;
import java.util.Observer;

/**
 * Created by td on 2017/7/1.
 */
public class ModelRoot extends Observable implements Serializable {

    private static ModelRoot modelRootInstance;

    private LinkedList<AttackResult> attackResultLinkedList;

    public ModelRoot() {
        attackResultLinkedList = new LinkedList<AttackResult>();
    }

    public static ModelRoot getModelRootInstance(){
        if (modelRootInstance==null){
            modelRootInstance = new ModelRoot();
        }
        return modelRootInstance;
    }

    public LinkedList<AttackResult> getAttackResultLinkedList() {
        return attackResultLinkedList;
    }

    public void addAttackResult(AttackResult attackResult){

        attackResultLinkedList.add(attackResult);
        this.setChanged();
        this.notifyObservers(attackResult);

    }

}
